<template>
  <div id="newcomer-fission">
    <c-title :hide="false" text="新客裂变"></c-title>
    <div class="top-describe">
      <img :src="info.avatar" alt="" />
      <div class="right-name">
        <span class="member-name">{{info.nickname}}</span>
        <span class="member-level">{{info.level_name}}</span>
      </div>
    </div>
    <div class="context">
      <div class="reward-record" @click="goRewardRecord">
        <span class="reward-record-name">奖励明细</span>
        <van-icon name="arrow" />
      </div>
      <!-- <div class="context-detail">
        <span class="top-name">我的{{ fun.getBalanceLang() }}</span>
        <div class="reward">
          <span class="reward-name">累计奖励{{ fun.getBalanceLang() }}</span>
          <span class="reward-num">￥{{list.amounts}}</span>
        </div>
        <div class="line-border"></div>
        <div class="settlement">
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.already_amounts}}</span>
            <span class="settlement-status">已结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.wait_amounts}}</span>
            <span class="settlement-status">待结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.invalid_amounts}}</span>
            <span class="settlement-status">无效奖励</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.expect_amounts}}</span>
            <span class="settlement-status">预计奖励</span>
          </div>
        </div>
      </div>
      <div class="context-detail">
        <span class="top-name">我的收入</span>
        <div class="reward">
          <span class="reward-name">累计奖励收入</span>
          <span class="reward-num">￥{{list.income}}</span>
        </div>
        <div class="line-border"></div>
        <div class="settlement">
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.already_income}}</span>
            <span class="settlement-status">已结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.wait_income}}</span>
            <span class="settlement-status">待结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.invalid_income}}</span>
            <span class="settlement-status">无效奖励</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">￥{{list.expect_income}}</span>
            <span class="settlement-status">预计奖励</span>
          </div>
        </div>
      </div> -->
      <!-- <div class="context-detail">
        <span class="top-name">我的{{ fun.getCustomTextLang('member_center.credit1','积分') }}</span>
        <div class="reward">
          <span class="reward-name">累计奖励{{ fun.getCustomTextLang('member_center.credit1','积分') }}</span>
          <span class="reward-num">{{list.points}}</span>
        </div>
        <div class="line-border"></div>
        <div class="settlement">
          <div class="settlement-detail">
            <span class="settlement-num">{{list.already_points}}</span>
            <span class="settlement-status">已结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.wait_points}}</span>
            <span class="settlement-status">待结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.invalid_points}}</span>
            <span class="settlement-status">无效奖励</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.expect_points}}</span>
            <span class="settlement-status">预计奖励</span>
          </div>
        </div>
      </div> -->
      <!-- <div class="context-detail">
        <span class="top-name">我的优惠券</span>
        <div class="reward">
          <span class="reward-name">累计奖励优惠券</span>
          <span class="reward-num">{{list.coupons}}张</span>
        </div>
        <div class="line-border"></div>
        <div class="settlement">
          <div class="settlement-detail">
            <span class="settlement-num">{{list.already_coupons}}张</span>
            <span class="settlement-status">已结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.wait_coupons}}张</span>
            <span class="settlement-status">待结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.invalid_coupons}}张</span>
            <span class="settlement-status">无效奖励</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.expect_coupons}}张</span>
            <span class="settlement-status">预计奖励</span>
          </div>
        </div>
      </div> -->
      <div class="context-detail" v-if="list.love_show">
        <span class="top-name">我的{{list.love_name}}</span>
        <div class="reward">
          <span class="reward-name">累计{{list.love_name}}</span>
          <span class="reward-num">{{list.love}}</span>
        </div>
        <div class="line-border"></div>
        <div class="settlement">
          <div class="settlement-detail">
            <span class="settlement-num">{{list.already_love}}</span>
            <span class="settlement-status">已结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.wait_love}}</span>
            <span class="settlement-status">待结算</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.invalid_love}}</span>
            <span class="settlement-status">无效奖励</span>
          </div>
          <div class="settlement-detail">
            <span class="settlement-num">{{list.expect_love}}</span>
            <span class="settlement-status">预计奖励</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import cTitle from "components/title";
export default {
  data() {
    return {
      info:{},
      list:{}
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    async getData() {
      let { data, result, msg } = await $http.post("plugin.newcomer-fission.frontend.controllers.center.index");
      if (result === 0) {
        this.$toast(msg);
        return;
      }
      this.info = data.info;
      this.list = data.list;
    },
    goRewardRecord() {
      this.$router.push(this.fun.getUrl("newcomerReward"));
    }
  },
  components: { cTitle }
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#newcomer-fission {
  .top-describe {
    background-color: #ff8924;
    display: flex;
    padding: 1.28rem 0 2.81rem 0.97rem;

    img {
      width: 3.44rem;
      height: 3.44rem;
      border-radius: 50%;
      margin: 0 0.44rem 0 0;
    }

    .right-name {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      text-align: left;

      .member-name {
        font-size: 1rem;
        font-weight: normal;
        font-stretch: normal;
        line-height: 1.5rem;
        color: #fff;
      }

      .member-level {
        background: white;
        padding: 0.28rem 0.69rem;
        font-size: 0.69rem;
        font-weight: normal;
        font-stretch: normal;
        color: #ba750c;
        line-height: 1;
        border-radius: 0.63rem;
      }
    }
  }

  .context {
    position: relative;
    top: -1.8rem;

    .context-detail {
      background-color: #fff;
      border-radius: 0.31rem;
      display: flex;
      flex-direction: column;
      text-align: left;
      margin: 0.63rem;
      padding: 0.94rem 0.84rem 1.13rem 0.84rem;

      .top-name {
        font-size: 0.81rem;
        font-weight: normal;
        font-stretch: normal;
        color: #ff8924;
        margin-bottom: 0.91rem;
        text-align: center;
      }

      .reward {
        display: flex;
        justify-content: space-between;
        // margin-bottom: 1.88rem;
        line-height: 1;

        .reward-name {
          font-size: 0.88rem;
          font-weight: normal;
          font-stretch: normal;
          color: #353535;
        }

        .reward-num {
          font-size: 0.88rem;
          font-weight: normal;
          font-stretch: normal;
          color: #f15353;
        }
      }

      .line-border {
        height: 0.03rem;
        background-color: #f2f2f2;
        margin: 0.75rem 0 1.09rem 0;
      }

      .settlement {
        display: flex;
        justify-content: space-around;

        .settlement-detail {
          display: flex;
          flex-direction: column;
          align-items: center;

          .settlement-num {
            font-size: 0.81rem;
            font-weight: bold;
            font-stretch: normal;
            line-height: 1;
            color: #f14e4e;
            margin-bottom: 0.81rem;
          }

          .settlement-status {
            font-size: 0.69rem;
            font-weight: bold;
            font-stretch: normal;
            line-height: 1;
            color: #696969;
          }
        }
      }
    }

    .reward-record {
      display: flex;
      background: white;
      padding: 0.81rem 0.84rem;
      justify-content: space-between;
      margin: 0 0.63rem 0.63rem 0.63rem;
      line-height: 1;

      .reward-record-name {
        font-size: 0.88rem;
        font-weight: normal;
        font-stretch: normal;
        color: #353535;
      }
    }
  }
}
</style>
